lcDrwAddBlockFromDrw Home

Creates a block in a drawing by coping its data from another drawing.

 HANDLE lcDrwAddBlockFromDrw (
   HANDLE hDrw,
   LPCWSTR szName,
   HANDLE hDrw2,
   int Overwrite,
   HWND hWndParent
 );

Parameters
hDrw
  Handle to a drawing object.
szName
  Block name. The block with this name must exist in the drawing hDrw2. If the block exist in the hDrw, it will be overwritten, depend on the Overwrite parameter.
If an empty string is specified for the name, then this function will add all blocks which exist in the drawing hDrw2.
hDrw2
  Handle to the drawing object which contains the original block.
Overwrite
  Overwrite mode. Defines LiteCAD behaviour if copied block already exist in the drawing. Can be one of the following constants:

Value Meaning
LC_BLOCK_OVERWRITENO Do not overwrite exist block
LC_BLOCK_OVERWRITEYES Always overwrite exist block
LC_BLOCK_OVERWRITEDLG Display a dialog, where a user can choose an option.
hWndParent
  Handle to a parent window for the "Overwrite block" dialog. Specify NULL if the LC_BLOCK_OVERWRITEDLG mode is not used.

Return Value

  Handle to a new block.
If the function fails, the return value is NULL.

Remarks

  If the copied block has references to other blocks, then they also will be copied. Also will be copied all referenced named objects, like layers, linetypes, text stylles, etc.

See Also

  Code sample 1,   Code sample 2,   lcDrwAddBlockFromFilelcDrwAddBlockFileBlock reference